<template>
	<div class="div5">
		<el-form ref="type" :model="type" label-width="100px">
			<el-form-item label="一级ID">
				<el-input v-model="type.id" readonly></el-input>
			</el-form-item>
	
			<el-form-item label="一级类型名称">
				<el-input v-model="type.name"></el-input>
			</el-form-item>
	
			<el-form-item label="显示顺序">
				<el-input v-model="type.prio"></el-input>
			</el-form-item>
			<el-button @click="updateType()">保存</el-button>
		</el-form>
	</div>
</template>

<script>
	export default {
		name:'UpdateType',
		data(){
			return{
				type:{},
				t:[]
			}
		},
		methods:{
			updateType(){
				console.log(this.type);
				this.$postk("/api/adm/type/add"+"?"+"id="+this.type.id+"&name="+this.type.name+"&pid="+this.type.pid+"&prio"+this.type.prio).then((resp) => {
					console.log(resp.data);
					console.log(this.type);
				})
			}
		},
		mounted(){
			this.$get("/api/adm/type/findById/"+this.$route.query.id).then((resp) => {
				console.log(resp.data);
				this.type=resp.data.data;
				})
		}
	}
</script>

<style>
</style>
